<template>
	<div class="left" id="left">
    <div class="kflexcc"><img src="../../static/kuanping/logo.png" style="margin: 20px 0; width: 139px; cursor: pointer;" @click="go('/index')"></div>
		<div class="nav">
			<div class="navli">
				<router-link to="/adminyijianfankui">
          <img src="../../static/kuanping/left2.svg" style="margin-right: 5px; width: 14px;">
          用户反馈
        </router-link>
			</div>
		</div>
	</div>
</template>

<script>
	import axios from 'axios'
	// import func from '../../vue-temp/vue-editor-bridge';
	export default {
		name: 'left',
		data() {
			return {
				messagenum: 0,
				ordershow: [],
				productshow: [],
				numbershow: [],
				waihushow: [],
				caiwushow: [],
				lianghaoshow: [],
				productionshow: [],
				myDistributorshow: [],
				user_func: [],
        tuikuanshow:[],

				func_A: false,
				func_B: false,
				func_C: false,
				func_D: false,
				func_E: false,
				func_F: false,
				func_G: false,
				func_H: false,
				func_I: false,
				func_J: false,
				func_K: false,
				func_L: false,
				func_M: false,
				func_N: false,
				func_U: false,
				func_Q01:false,
				func_Q0101:false,
				func_Q0102:false,

				func_J01: false,
				func_J02: false,
				func_J04: false,
				func_I03: false,
        func_R01:false,

				P02: false,
				P01: false,
        func_S:false,

				shop: "",
				shopid: "",

				user: "",

        dizhi:"",
		newVal:null
			}
		},
		created() {
			

      this.dizhi = this.$route.path

			var that = this
			this.myDistributorshow = sessionStorage.getItem('myDistributorshow');
			this.productionshow = sessionStorage.getItem('productionshow');
			this.ordershow = sessionStorage.getItem('ordershow');
			this.zhiboshow = sessionStorage.getItem('zhiboshow');

			this.productshow = sessionStorage.getItem('productshow');
      this.tuikuanshow = sessionStorage.getItem('tuikuanshow');

			this.numbershow = sessionStorage.getItem('numbershow');
			this.waihushow = sessionStorage.getItem('waihushow')
			this.caiwushow = sessionStorage.getItem('caiwushow')
			this.lianghaoshow = sessionStorage.getItem('lianghaoshow')


			this.user = JSON.parse(localStorage.getItem('USER'));
			//权限问题
			var user = JSON.parse(localStorage.getItem('USER'));

			this.user_func = user.functions
			this.shop = user.id
			for (var i in this.user_func) {
				if (this.user_func[i] != null) {
					var func_number = this.user_func[i].code
				}
				if (func_number.indexOf("A") >= 0) {
					this.func_A = true
				}
				if (func_number.indexOf("B") >= 0) {
					this.func_B = true
				}
				if (func_number.indexOf("C") >= 0) {
					this.func_C = true
				}
				if (func_number.indexOf("D") >= 0) {
					this.func_D = true
				}
				// if(func_number.indexOf("E") >= 0){ this.func_E = true }
				if (func_number.indexOf("F") >= 0) {
					this.func_F = true
				}
				if (func_number.indexOf("G") >= 0) {
					this.func_G = true
				}
				if (func_number.indexOf("H") >= 0) {
					this.func_H = true
				}
				if (func_number.indexOf("I") >= 0) {
					this.func_I = true
				}
				if (func_number.indexOf("I03") >= 0) {
					this.func_I03 = true
				}
				if (func_number.indexOf("J") >= 0) {
					this.func_J = true
				}
				if (func_number.indexOf("Q01") >= 0) {
					this.func_Q01 = true
				}
        if (func_number.indexOf("R01") >= 0) {
        	this.func_R01 = true
        }

				if (func_number.indexOf("Q0101") >= 0) {
					this.func_Q0101 = true
				}
				if (func_number.indexOf("Q0102") >= 0) {
					this.func_Q0102 = true
				}

				if (func_number.indexOf("K") >= 0) {
					this.func_K = true
				}
				if (func_number.indexOf("L") >= 0) {
					this.func_L = true
				}
				if (func_number.indexOf("M") >= 0) {
					this.func_M = true
				}
				if (func_number.indexOf("N") >= 0) {
					this.func_N = true
				}

				if (func_number.indexOf("J01") >= 0) {
					this.func_J01 = true
				}
				if (func_number.indexOf("J02") >= 0) {
					this.func_J02 = true
				}
				if (func_number.indexOf("J04") >= 0) {
					this.func_J04 = true
				}
				if (func_number.indexOf("P") >= 0) {
					this.P = true
				}
				if (func_number.indexOf("P01") >= 0) {
					this.P01 = true
				}
				if (func_number.indexOf("P02") >= 0) {
					this.P02 = true
				}
        if (func_number.indexOf("S") >= 0) {
        	this.func_S = true
        }
		if (func_number.indexOf("U") >= 0) {
					this.func_U = true
				}
			}
			//店铺权限问题
			this.shopid = JSON.parse(localStorage.getItem('SHOP')).shop_id;
		},

		mounted() {


      if(localStorage.getItem('congnalai') != '/login'){
        let x = document.getElementById('left')
        x.scrollTo({
          top:localStorage.getItem('h')
        })
      }


      if(document.getElementById('left')){
        let x = document.getElementById('left')
        x.addEventListener('scroll', ()=>{
          let h = x.scrollTop
          localStorage.setItem('h',h)
        })
      }
    },

		methods: {
      go:function(url){
        this.$router.push(url)
      },
      gozhibo:function(){
        var arrstr = document.cookie.split("; ");
        let cookie = ''
        for(var i = 0;i < arrstr.length;i ++){
          var temp = arrstr[i].split("=");
            if(temp[0] == 'laravel_session') {
              cookie = temp[1]
            }
        }
        window.open('http://storep.91haoka.cn/web/zhiboxitong/zhiboxiaoshou?cookie='+cookie)

      },
      tuikuanchange: function() {
      	if (this.tuikuanshow.indexOf("1") >= 0) {
      		sessionStorage.setItem('tuikuanshow', 1);
      	} else {
      		sessionStorage.setItem('tuikuanshow', 0);
      	}
      },
			myDistributorchange: function() {
				if (this.myDistributorshow.indexOf("1") >= 0) {
					sessionStorage.setItem('myDistributorshow', 1);
				} else {
					sessionStorage.setItem('myDistributorshow', 0);
				}
			},
			productionchange: function() {
				if (this.productionshow.indexOf("1") >= 0) {
					sessionStorage.setItem('productionshow', 1);
				} else {
					sessionStorage.setItem('productionshow', 0);
				}
			},
			numberchange: function() {
				if (this.numbershow.indexOf("1") >= 0) {
					sessionStorage.setItem('numbershow', 1);
				} else {
					sessionStorage.setItem('numbershow', 0);
				}
			},
			waihuchange: function() {
				if (this.waihushow.indexOf("1") >= 0) {
					sessionStorage.setItem('waihushow', 1);
				} else {
					sessionStorage.setItem('waihushow', 0);
				}
			},
			orderchange: function() {
				if (this.ordershow.indexOf("1") >= 0) {
					sessionStorage.setItem('ordershow', 1);
				} else {
					sessionStorage.setItem('ordershow', 0);
				}
			},
			zhibochange: function() {
				if (this.zhiboshow.indexOf("1") >= 0) {
					sessionStorage.setItem('zhiboshow', 1);
				} else {
					sessionStorage.setItem('zhiboshow', 0);
				}
			},
			prochange: function() {
				if (this.productshow.indexOf("1") >= 0) {
					sessionStorage.setItem('productshow', 1);
				} else {
					sessionStorage.setItem('productshow', 0);
				}
			},
			caiwuchange: function() {
				if (this.caiwushow.indexOf("1") >= 0) {
					sessionStorage.setItem('caiwushow', 1);
				} else {
					sessionStorage.setItem('caiwushow', 0);
				}
			},
			lianghaochange: function() {
				if (this.lianghaoshow.indexOf("1") >= 0) {
					sessionStorage.setItem('lianghaoshow', 1);
				} else {
					sessionStorage.setItem('lianghaoshow', 0);
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.left {
		background: #fff;
		position: relative;
    transition: all 0.2s;
    overflow-x: hidden;
    /deep/ .el-collapse-item__arrow{ font-weight: bold !important;}


		.nav {
      width: 194px; margin: 0 3px;

			/deep/ .router-link-active {
				background: #EEF7FF;
				color: #F1F8FF !important;
        img{
            filter: drop-shadow(#F1F8FF 100px 0) !important;
            transform: translateX(-100px);
        }
			}


      /deep/ .el-collapse-item__header{ line-height: 49px; height: 49px; color: #7B8699; padding-left: 25px; font-weight: bold; border: none;

      }
      /deep/ .el-collapse-item__content{ background: #fff; padding-bottom: 0;}
			.navli {
				line-height: 50px;
				color: #7B8699;
				font-size: 14px;
				cursor: pointer;
        border-radius: 5px;
        font-weight: bold;

				a {
					color: #7B8699;
					display: block;
					padding-left: 25px;
          display: flex; align-items: center;
          border-radius: 5px;

          &:hover {
          	color: #F1F8FF !important;
          }
				}

        img{
          filter: drop-shadow(#C0C6D2 100px 0);
          transform: translateX(-100px);
        }

				&:hover {
					background: #EEF7FF; transition: all 0.2s;
          img{
              filter: drop-shadow(#F1F8FF 100px 0);
              transform: translateX(-100px);
          }
				}
			}

			.navli2 {
				line-height: 50px !important;
				font-size: 14px;
				cursor: pointer;

				a {
					display: block;
					padding-left: 55px;
          color: #7B8699;

          &:hover {
          	color: #F1F8FF !important;
          }
				}


			}

			/deep/ .el-collapse {
				border: none
			}

			/deep/ .el-collapse-item__wrap {
				background: #393E4A;
				border: none;
			}
			.is-active {}
		}

		.tac {
			height: 100%;

			/deep/ .is-opened {
				background: rgb(38, 52, 69) !important;
			}

			/deep/ .el-menu {
				height: 100%;
				width: 100%;
			}
		}
    .xin{
       background: url(https://photo.91haoka.cn/haoka_mobile/new.gif) no-repeat; background-size: 40px; background-position: 110px center;



      /deep/ .router-link-active {
      	background: url(https://photo.91haoka.cn/haoka_mobile/new.gif) no-repeat #EEF7FF; background-size: 40px; background-position: 110px center ;
      	color: #F1F8FF !important;
        img{
            filter: drop-shadow(#F1F8FF 100px 0) !important;
            transform: translateX(-100px);
        }
      }
    }
	}
</style>
